<?php
namespace app\zhonghang\controller;
use think\Controller;
use think\Db;
use think\Session;
class Login extends Controller {
	public function _initialize(){
		parent::_initialize();
		
	}
	//空操作
	public function _empty(){
		header("HTTP/1.0 404 Not Found");
		$this->display('Public:404');
	}
	

	/*
	 * 小程序根据openID登录和注册
	 */
	public function userLoginAndRegister(){
	    $openid = input('openid');   //接收用户openid
        $user = Db::name('users')->where('openid',$openid)->find();
        if($user){   //如果存在该openID用户   显示登陆成功
            $re['info'] = '登陆成功';
            $re['status'] = 9;
            return json($re);
        }else{   //如果没有该openID信息  则为注册用户
            //新增用户信息操作


            //----------------
        }
    }





















}